<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8" name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>登录</title>
    <style>
        #loginModal{
            height: 400px;
            top:50%;
            transform:translateY(-50%);
        }
    </style>
</head>
<body>

<!-- 登录框 -->
<div class="modal fade" id="loginModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">您好，请登录!</h4>
            </div>
            <div class="modal-body row">
                <div class="col-md-8 col-md-offset-2">
                    <form action="index.html">
                        <div class="input-group form-group"><!--组合框中出现label会破坏样式-->
                            <span class="input-group-addon" id="sizing-addon1"><span class="glyphicon glyphicon-user"></span></span>
                            <input id="username" class="form-control" name="username" placeholder="用户名"  aria-describedby="sizing-addon1">
                        </div>
                        <div class="input-group form-group">
                            <span class="input-group-addon" id="sizing-addon2"><span class="glyphicon glyphicon-lock"></span></span>
                            <input id="password" class="form-control" name="password" placeholder="密码"  aria-describedby="sizing-addon2" type="password">
                        </div>
                        <div class="checkbox">
                            <label for="remember">
                                <input id="remember" name="remember" type="checkbox"> 记住密码
                            </label>
                        </div>
                        <div class="form-group">
                            <input class="btn btn-success form-control" type="submit" value="登 录">
                        </div>

                    </form>
                </div>

            </div>
            <div class="modal-footer">
                <a  class="btn btn-warning" >忘记密码</a>
                <button id="regBtn" type="button" class="btn btn-primary">免费注册</button>
            </div>
        </div>
    </div>
</div>

<script>
    $(function(){
        $('#loginModal').modal({
            show:true,
            backdrop:true
        })

    });
</script>
</body>
</html>